Page({
  data: {
    detail: {},
  },
  onLoad({ id }) {
    this.id = id
    this.getHouseDetail(id)
  },
  // 获取房屋详情
  getHouseDetail(id) {
    wx.http.get(`/room/${id}`).then((res) => {
      if (res.code !== 10000) return wx.utils.toast()
      this.setData({ detail: res.data })
    })
  },
  editHouse() {
    wx.navigateTo({
      // url: '/house_pkg/pages/form/index?id=' + this.data.detail.id,
      url: '/house_pkg/pages/form/index?id=' + this.id,
    })
  },
})
